#include "forminfo.h"
#include "ui_forminfo.h"

#include <QFile>
#include <QTextStream>

FormInfo::FormInfo(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::FormInfo)
{
    ui->setupUi(this);

    // 不允许调整窗口大小
    setWindowFlags(windowFlags()& ~Qt::WindowMaximizeButtonHint);
    setFixedSize(this->width(), this->height());

    ui->textBrowserInfo->setText(initText());
}

FormInfo::~FormInfo()
{
    delete ui;
}

QString FormInfo::initText()
{
    QFile inputFile(":/assets/README.txt");
    inputFile.open(QIODevice::ReadOnly);
    QTextStream in(&inputFile);
    return in.readAll();
}

void FormInfo::on_pushButtonClose_clicked()
{
    this->close();
}

